<template>
    <div>
        这是主组件
        <Child @xxx="handleXXX" @click.native="handleClick" @setNum="setNum"/>
        <Son ref="sonRef" />
    </div>
</template>
<script>
import Child from './Child.vue';
import Son from './Son.vue';
export default {
    name: "App",
    data() {
        return {
            num:0
        }
    },
    components: {
        Child,
        Son,
    },
    methods: {
        handleXXX() { 
            console.log("触发事件");
        },
        handleClick() { 
            console.log("触发事件11");
        },
        setNum() { 
            this.num++;
        }
    },
    mounted(){
       console.log(this.$refs.sonRef); 
    }
}
</script>
<style>

</style>